google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(function(){ var data = new google.visualization.DataTable(); data.addColumn('string', '日'); data.addColumn('number', '推測'); data.addColumn('number', '推測'); data.addColumn('number', 'iOS前月'); data.addColumn('number', 'iOS当月'); data.addRows([ ['1日',386,406,null,null], ['2日',405,398,null,null], ['3日',475,409,null,null], ['4日',342,379,null,null], ['5日',430,445,null,null], ['6日',390,435,null,null], ['7日',468,478,null,null], ['8日',469,399,null,null], ['9日',423,429,null,null], ['10日',440,337,null,null], ['11日',364,383,null,null], ['12日',448,473,null,null], ['13日',403,465,null,null], ['14日',416,444,null,null], ['15日',438,384,null,null], ['16日',432,351,null,null], ['17日',411,318,null,null], ['18日',424,426,null,null], ['19日',374,430,null,null], ['20日',350,436,null,null], ['21日',338,432,null,null], ['22日',435,378,null,null], ['23日',301,359,null,null], ['24日',337,322,null,null], ['25日',358,417,null,null], ['26日',442,425,null,null], ['27日',380,456,null,null], ['28日',484,425,null,null], ['29日',464,373,null,null], ['30日',424,438,null,null], ['31日',493,null,null,null] ]); var options = { chartArea: {'width':'85%', 'height':'65%', 'left':60 }, 'pointSize': 3, hAxis: { titleTextStyle:{italic:false}, format:'#',ticks: [1,5,10,15,20,25,30] }, vAxis: { title:'2024年4月ランキング', titleTextStyle:{italic:false}, format:'#',viewWindow:{min:0,max:500},direction:-1 }, legend: {position: 'top' }, tooltip: { trigger: 'both' }, focusTarget: 'category', colors:['skyblue','pink','#2980b9','#e74c3c'] }; var chart = new google.visualization.LineChart(document.getElementById('graphField')); chart.draw(data, options); var lastlogday=30 -1 ; var lastlogcat=2; if(lastlogday>=0){ chart.setSelection([{ row: lastlogday, column: lastlogcat }]); google.visualization.events.addListener(chart, 'click', function() { if(chart.getSelection()[0]){ //chart.setSelection(null) } }); } });